Hi,
Can anybody help me to import HTML format file in to Doors9.1? I get HTML format requirement from customer, when it is converted to any other formats the complete structure is getting changed.
Please let me know the possibility. Thanks a lot in advance.
JayashreeRaddi - Fri Jul 15 01:40:23 EDT 2011 |
|
Re: Import HTML format OurGuest - Fri Jul 15 09:36:15 EDT 2011
One approach is to save as ms word document, then import.
|
|
Re: Import HTML format SystemAdmin - Mon Jul 18 03:34:47 EDT 2011
Seems unusual that customer has delivered requirements in HTML format - it needs to be an RTF or MSWord doc format to have any decent chance of importing into DOORS. It might be worth asking if the HTML format was perhaps originally based on a MSWord document or something that can be converted into an RTF format?
Paul Miller
Melbourne, Australia
|
|
Re: Import HTML format Mathias Mamsch - Mon Jul 18 07:13:54 EDT 2011
HTML Format alone is not sufficient to answer your question ... Yes DOORS has functions for reading HTML and converting to richText (e.g., HTMLToRichText) but you still would need to parse the structure of the HTML document, extract the HTML code for a specific requirement (however you will find it in the document you have been given) and then create a DOORS object for it, convert the HTML using the function.
However there is no custom HTML import as far as I know, so you either would need to go to an intermediate format like MS-Word or write your own importer (which is always no fun!). Hope that helps, Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
|
Re: Import HTML format SystemAdmin - Mon Dec 19 17:21:18 EST 2011 Mathias Mamsch - Mon Jul 18 07:13:54 EDT 2011
HTML Format alone is not sufficient to answer your question ... Yes DOORS has functions for reading HTML and converting to richText (e.g., HTMLToRichText) but you still would need to parse the structure of the HTML document, extract the HTML code for a specific requirement (however you will find it in the document you have been given) and then create a DOORS object for it, convert the HTML using the function.
However there is no custom HTML import as far as I know, so you either would need to go to an intermediate format like MS-Word or write your own importer (which is always no fun!). Hope that helps, Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
I could have sworn this function worked with limited support in the past (e.g., bold, underline, italic). With DOORS 9.3 it seems to return nothing.
Can anyone get a richText string out of the HTMLToRichText(&Buffer) perm?
I would think the below would render The bold ones in rich text format but I get nothing.
Buffer b = create;
b = "<b>The bold ones</b>";
string htmlText = stringOf(b);
ack "htmlText = " htmlText "\n HTMLToRichText(\"" htmlText "\") = [" HTMLToRichText(b) "]";
Am I calling it wrong or was this perm left behind?
|
|
Re: Import HTML format OurGuest - Tue Dec 20 15:18:29 EST 2011 SystemAdmin - Mon Dec 19 17:21:18 EST 2011
I could have sworn this function worked with limited support in the past (e.g., bold, underline, italic). With DOORS 9.3 it seems to return nothing.
Can anyone get a richText string out of the HTMLToRichText(&Buffer) perm?
I would think the below would render The bold ones in rich text format but I get nothing.
Buffer b = create;
b = "<b>The bold ones</b>";
string htmlText = stringOf(b);
ack "htmlText = " htmlText "\n HTMLToRichText(\"" htmlText "\") = [" HTMLToRichText(b) "]";
Am I calling it wrong or was this perm left behind?
If I am reading this undocumented function correctly, it appears that the functions returns the markup in buffer b instead of returning a string as you have it used here.
|
|
Re: Import HTML format llandale - Wed Dec 21 11:20:36 EST 2011 OurGuest - Tue Dec 20 15:18:29 EST 2011
If I am reading this undocumented function correctly, it appears that the functions returns the markup in buffer b instead of returning a string as you have it used here.
Yes. The command is:
-
string HTMLToRichText(Buffer&)
which means it modifies the buffer, and I'm pretty sure the returned string is the Error message, such as when the buffer doesn't hold a valid rich text string. So you need to print tempStringOf(b) after the call.
-Louie
|
|
Re: Import HTML format llandale - Wed Dec 21 11:26:00 EST 2011 llandale - Wed Dec 21 11:20:36 EST 2011
Yes. The command is:
-
string HTMLToRichText(Buffer&)
which means it modifies the buffer, and I'm pretty sure the returned string is the Error message, such as when the buffer doesn't hold a valid rich text string. So you need to print tempStringOf(b) after the call.
-Louie
.. err.. doesn't hold valid HTML.
|
|
Re: Import HTML format SystemAdmin - Wed Dec 21 15:37:07 EST 2011 llandale - Wed Dec 21 11:26:00 EST 2011
.. err.. doesn't hold valid HTML.
Thanks OurGuest for pointing out that the single parameter Buffer& was an in/out parameter and the return value was not the richText result of conversion.
The Buffer as an in/out parameter threw me at first but I got the below working. If this function is like the others, DOORS will convert a VERY small subset of HTML most likely limited to bold, italic, underline and similar.
If anyone knows what it can and cannot do, please post.
I attached output result as a PNG file (attachment).
void dbReleaseMe(DB box) {
hide(box)
destroy(box);
}
RTF_string__ richTextOfHtml(string htmlText) {
Buffer b = create();
b = htmlText;
//--------------------------------------------------------------------------
// NOTE: b is an in/out parameter. Upon call, HTML text is read from the
// input buffer. Upon function completion, the same buffer's content
// will be replaced with rich text that corresponds to the HTML
// supplied as input. The string return value may contain an
// error message if the conversion is unsuccessful (I have only gotten
// empty strings in my experiments).
//--------------------------------------------------------------------------
string errorMsg = HTMLToRichText(b);
// Never got one ...
if (length(errorMsg) > 0) {
ack("Error during HTMLToRichText(): " errorMsg);
halt;
}
RTF_string__ richTextString = richText(stringOf(b));
delete b;
b = null;
return richTextString;
}
void htmlToRichTextExperiment() {
string htmlString;
htmlString = "Normal" //-
" <b>bold</b>" //-
" <i>italic</i>" //-
" <u>underlined</u> " //-
" back to normal";
DB box = centered("HTML Experiment");
bool readOnly = true;
DBE field1 = richField(box, "Original: ", richText(htmlString), 60, readOnly);
DBE field2 = richField(box, "Converted: ", richTextOfHtml(htmlString), 60, readOnly);
close(box, false, dbReleaseMe);
show(box)
}
htmlToRichTextExperiment();
Attachments
attachment_14771431_HTMLToRichText.png
|
|